package com.richinfo.app1.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.integration.annotation.Payload;

import com.richinfo.common.entity.User;

/**
 * 消息消费者
 * 
* Created by WangXJ
* 2018-11-28 14:35
*/
@EnableBinding(value = MyInput.class)
public class SinkConsumer {

	private static Logger logger = LoggerFactory.getLogger(SinkConsumer.class);
	
	@StreamListener(value = MyInput.INPUT)
	public void receive(User user) {
		logger.info("Received : " + user);
		logger.info("age : " + user.getAge());
	}
}
